<?php
// No direct access to this file
defined('_JEXEC') or die;
 
/**
 * HelloWorld component helper.
 */
abstract class ShopHelper
{
	/**
	 * Configure the Linkbar.
	 */
	public static function addSubmenu($submenu) 
	{
		JSubMenuHelper::addEntry(JText::_('COM_SHOP_PRODUCTS'), 'index.php?option=com_shop&view=products', $submenu == 'products');
		JSubMenuHelper::addEntry(JText::_('COM_SHOP_CATEGORIES'), 'index.php?option=com_shop&view=categories', $submenu == 'categories');
		JSubMenuHelper::addEntry(JText::_('COM_SHOP_METHODS'), 'index.php?option=com_shop&view=methods', $submenu == 'methods');
		JSubMenuHelper::addEntry(JText::_('COM_SHOP_ADDRESSES'), 'index.php?option=com_shop&view=addresses', $submenu == 'addresses');
		JSubMenuHelper::addEntry(JText::_('COM_SHOP_EMPLOYERS'), 'index.php?option=com_shop&view=employers', $submenu == 'employers');
		JSubMenuHelper::addEntry(JText::_('COM_SHOP_ORDERS'), 'index.php?option=com_shop&view=orderes', $submenu == 'orderes');
	}
	/**
	 * Get the actions
	 */
	public static function getActions($menu = '')
	{
		$user	= JFactory::getUser();
		$result	= new JObject;
		
		if ( $menu == '' ) {
			$assetName = 'com_shop';
		}
		else {
			$assetName = 'com_shop.'.$menu;
		}
		
  		$actions = array(
			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.delete'
		);
		foreach ($actions as $action) {
			$result->set($action,	$user->authorise($action, 'com_shop'));
		}
 
		return $result;
	}
}
